<style>
.spanlevel {
  font-size: 22px;
  font-weight: bold;
  color: black;
  padding: 10px;
}
.spanblod {
  font-weight: bold;
  color: black;
}
.checklevel {
  padding-right: 50px;
  zoom: 1.2;
}
.divtablemain {
  width: 100%;
  color: black;
  max-width: 980px;
}
.tablemain {
  width: 100%;
  border-collapse: collapse;
}
.tablemain td {
  line-height: 40px;
  min-width: 80px;
  height: 50px;
  color: black;
  text-align: center;
  border: 1px solid black;
}
.tdimg {
  width: 240px;
  height: auto;
  cursor: pointer;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table td {
  min-width: 80px;
  text-align: center;
  border: 1px solid #e8eaec;
}
.tableleft {
  text-align: left !important;
  padding: 10px;
  line-height: 24px;
}
.padding-10 {
  padding: 10px;
}
.imgmemo {
  width: 100%;
}
.imgperson {
  height: auto;
  width: 160px;
  margin: 5px;
  cursor: pointer;
}
.div-img {
  border: 1px solid #e8eaec;
  margin-right: 10px;
  cursor: pointer;
}
.signimg {
  width: 100px;
  border: 0;
}
</style>
<template>
  <div>
    <Card title="评估报告">
      <a href="#" slot="extra" @click.prevent="PrintReport">打印</a>
      <Row>
        <Center style="color:black">
          <h2>身体能力等级评估报告书</h2>
          <h3>The physical ability rating report<span style="margin-left:10px">评估人：{{assessinfo.sys_CreaterName}}</span></h3>
        </Center>
      </Row>
      <Row>
        <Center>
          <div class="divtablemain">
            <table border="1" cellspacing="0" cellpadding="0" class="tablemain">
              <tr>
                <td style="width: 130px;" rowspan="4">
                  评估对象
                  <br />基本信息
                </td>
                <td>姓名</td>
                <td>{{assessperson.Name}} {{assessperson.IsNew==1?"（新）":""}}</td>
                <td>性别</td>
                <td>{{assessperson.Sex}}</td>
                <td rowspan="4" style="width:180px;">
                  <viewer :images="assessinfo.PersonImg">
                    <img
                    :src="assessinfo.PersonImg"
                    class="imgperson" 
                  />
                  </viewer>
                </td>
              </tr>
              <tr>
                <td>出生日期</td>
                <td>{{assessperson.Birthday}}</td>
                <td>年龄</td>
                <td>{{assessperson.Age}}</td>
              </tr>
              <tr>
                <td>身份证号</td>
                <td colspan="3">{{assessperson.IdCard}}</td>
              </tr>
              <tr>
                <td>住址</td>
                <td colspan="3">{{assessperson.Address}}</td>
              </tr>
              <tr>
                <td>初步认定结果</td>
                <td colspan="5" class="tableleft">
                  <CheckboxGroup v-model="firstlevel">
                    <Checkbox label="0" onclick="return false" class="checklevel">
                      <span>自理</span>
                    </Checkbox>

                    <Checkbox label="2" onclick="return false" class="checklevel">
                      <span>半自理</span>
                    </Checkbox>

                    <Checkbox label="3" onclick="return false" class="checklevel">
                      <span>失能</span>
                    </Checkbox>
                  </CheckboxGroup>
                </td>
              </tr>
              <tr>
                <td>等级变更情况</td>
                <td colspan="5" class="tableleft">
                  <CheckboxGroup v-model="lelelmemo">
                    <Checkbox label="1" onclick="return false" class="checklevel">
                      <span>有认知障碍/痴呆、精神疾病</span>
                    </Checkbox>
                    <br />
                    <Checkbox label="2" onclick="return false" class="checklevel">
                      <span>近30天内发生过2次以上跌倒、噎食、自杀、走失情况</span>
                    </Checkbox>
                    <br />
                    <Checkbox label="4" onclick="return false" class="checklevel">
                      <span>有肢体残疾，视力一二级</span>
                    </Checkbox>
                    <br />
                    <Checkbox label="3" onclick="return false" class="checklevel">
                      <span>处于昏迷状态，直接评定为失能</span>
                    </Checkbox>
                    <br />
                    <Checkbox label="-1" onclick="return false" class="checklevel">
                      <span>无等级变更情况</span>
                    </Checkbox>
                  </CheckboxGroup>
                </td>
              </tr>
              <tr>
                <td colspan="2">评估现场影像资料</td>
                <td colspan="2">身体情况辅助证明资料</td>
                <td colspan="2">视频录像</td>
              </tr>
              <tr>
                <td colspan="2">
                  <viewer :images="img1">
                    <img :src="img1" class="tdimg" />
                  </viewer>
                </td>
                <td colspan="2" class="tdimg">
                  <viewer :images="img2">
                    <img :src="img2" class="tdimg" />
                  </viewer>
                </td>
                <td colspan="2">
                  <video
                    v-if="assessinfo.PersonVideo"
                    controls
                    :src="assessinfo.PersonVideo"
                    class="video"
                  >您的浏览器不支持播放视频</video>
                </td>
                
              </tr>
              <tr>
                <td>最终认定结果</td>
                <td colspan="5" class="tableleft">
                  <CheckboxGroup v-model="finallevel">
                    <Checkbox label="0" onclick="return false" class="checklevel">
                      <span>自理</span>
                    </Checkbox>

                    <Checkbox label="2" onclick="return false" class="checklevel">
                      <span>半自理</span>
                    </Checkbox>

                    <Checkbox label="3" onclick="return false" class="checklevel">
                      <span>失能</span>
                    </Checkbox>
                  </CheckboxGroup>
                </td>
              </tr>
              <tr>
                <td>备注</td>
                <td colspan="5" class="tableleft">{{assessinfo.Remark}}</td>
              </tr>
            </table>
            <Row type="flex" justify="center" align="middle" class="code-row-bg">
              <Col span="3" class="tableleft">评估员：</Col>
              <Col span="4" class="tableleft">
                <img :src="assessinfo.EmployeeName1" class="signimg" />
              </Col>
              <Col span="4" class="tableleft">
                <img :src="assessinfo.EmployeeName2" class="signimg" />
              </Col>
              <Col span="12">
                <br />临沂市慈济养老服务评估中心
                <br />
                {{assessinfo.BusinessDate }}
              </Col>
            </Row>
            <Row class="tableleft" style="font-size:10px;font-weight:bold">
              本次评估结果最终解释权归本中心所有 ，任何单位及个人未经允许，不得复制本报告！
              <br />附：老年人身体能力等级评估表
            </Row>
          </div>
        </Center>
      </Row>
    </Card>
    <br />

    <Card>
      <Row>
        <Center style="color:black">
          <h3>身体能力等级评定量表</h3>
        </Center>
      </Row>
      <Center>
        <div class="divtablemain">
          <table border="1" cellspacing="0" cellpadding="0" class="tablemain">
            <tr>
              <td style="width: 130px;">
                <span class="spanblod">进食</span>
              </td>
              <td class="tableleft">
                <span v-if="assessinfo.DailyFood==10">10分， 可独立进食（在合理的时间内独立进食准备好的食物）</span>
                <span v-else-if="assessinfo.DailyFood==5">5分，需部分帮助（进食过程中需要一定帮助，如协助把持餐具）</span>
                <span v-else-if="assessinfo.DailyFood==1">0分，需极大帮助</span>
                <span v-else-if="assessinfo.DailyFood==0">0分，完全依赖他人，或有留置营养管</span>
                <span v-else>10分，可独立进食（在合理的时间内独立进食准备好的食物）</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">洗澡</span>
              </td>

              <td class="tableleft">
                <span v-if="assessinfo.DailyShower==5">5分，准备好洗澡水后，可自己独立完成洗澡过程</span>
                <span v-else-if="assessinfo.DailyShower==2">0分，在洗澡过程中需他人较小帮助</span>
                <span v-else-if="assessinfo.DailyShower==1">0分，在洗澡过程中需他人较大帮助</span>
                <span v-else-if="assessinfo.DailyShower==0">0分，完全依赖他人</span>
                <span v-else>5分， 准备好洗澡水后，可自己独立完成洗澡过程</span>
              </td>
            </tr>

            <tr>
              <td>
                <span class="spanblod">修饰</span>
              </td>

              <td class="tableleft">
                <span v-if="assessinfo.DailyMakeup==5">5分，可独立完成</span>
                <span
                  v-else-if="assessinfo.DailyMakeup==2"
                >0分，需部分帮助(修饰过程中需要一定帮助，如协助打水等)</span>
                <span v-else-if="assessinfo.DailyMakeup==1">0分，需极大帮助（全程需要有人协助）</span>
                <span v-else-if="assessinfo.DailyMakeup==0">0分，完全依赖他人</span>
                <span v-else>5分，可独立完成</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">穿衣</span>
              </td>

              <td class="tableleft">
                <span v-if="assessinfo.DailyDress==10">10分，可独立完成</span>
                <span
                  v-else-if="assessinfo.DailyDress==5"
                >5分，需部分帮助（能自己穿脱，但需他人帮助系扣/鞋带、拉拉链）</span>
                <span v-else-if="assessinfo.DailyDress==1">0分，需较大帮助</span>
                <span v-else-if="assessinfo.DailyDress==0">0分，完全依赖他人</span>
                <span v-else>10分，可独立完成</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">大便控制</span>
              </td>
              <td class="tableleft">
                <span v-if="assessinfo.DailyRelieve==10">10分，可控制</span>
                <span v-else-if="assessinfo.DailyRelieve==5">5分，偶尔失控（每周&lt;1 次），或需要他人提示</span>
                <span v-else-if="assessinfo.DailyRelieve==1">0分，经常失控（每周&gt;1 次）</span>
                <span v-else-if="assessinfo.DailyRelieve==0">0分，完全失控</span>
                <span v-else>10分,可控制</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">小便控制</span>
              </td>
              <td class="tableleft">
                <span v-if="assessinfo.DailyPee==10">10分，可控制</span>
                <span v-else-if="assessinfo.DailyPee==5">5分，偶尔失控（每周&lt;1 次），或需要他人提示</span>
                <span v-else-if="assessinfo.DailyPee==1">0分，经常失控（每周&gt;1 次）</span>
                <span v-else-if="assessinfo.DailyPee==0">0分，完全失控</span>
                <span v-else>10分，可控制</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">如厕</span>
              </td>
              <td class="tableleft">
                <span v-if="assessinfo.DailyToilet==10">10分，可独立完成</span>
                <span
                  v-else-if="assessinfo.DailyToilet==5"
                >5分，需部分帮助（需他人搀扶去厕所或需他人帮忙冲水或整理衣裤等）</span>
                <span v-else-if="assessinfo.DailyToilet==1">0分，需极大帮助</span>
                <span v-else-if="assessinfo.DailyToilet==0">0分，完全依赖他人</span>
                <span v-else>10分，可独立完成</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">床椅转移</span>
              </td>
              <td class="tableleft">
                <span v-if="assessinfo.DailyMoveBed==15">15分，可独立完成</span>
                <span v-else-if="assessinfo.DailyMoveBed==10">10分，需部分帮助</span>
                <span v-else-if="assessinfo.DailyMoveBed==5">5分，需极大帮助</span>
                <span v-else-if="assessinfo.DailyMoveBed==0">0分，完全依赖他人</span>
                <span v-else>15分，可独立完成</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">平地行走</span>
              </td>

              <td class="tableleft">
                <span v-if="assessinfo.DailyWalk==15">15 分，可独立在平地上行走 45m</span>
                <span
                  v-else-if="assessinfo.DailyWalk==10"
                >10 分，需部分帮助（因肢体残疾、平衡能力差、过度衰弱、视力等问题，在一定程度上需他人地搀扶或使用拐杖、助行器等辅助用具）</span>
                <span
                  v-else-if="assessinfo.DailyWalk==5"
                >5 分， 需极大帮助（因肢体残疾、平衡能力差、过度衰弱、视力等问题，在较大程度上依赖他人搀扶，或坐在轮椅上自行移动）</span>
                <span v-else-if="assessinfo.DailyWalk==0">0 分， 完全依赖他人</span>
                <span v-else>15 分，可独立在平地上行走 45m</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">上下楼梯</span>
              </td>
              <td class="tableleft">
                <span v-if="assessinfo.DailyStairs==10">10分，可独立上下楼梯（连续上下10-15个台阶）</span>
                <span v-else-if="assessinfo.DailyStairs==5">5分，需部分帮助（需扶着楼梯、他人搀扶，或使用拐杖等）</span>
                <span v-else-if="assessinfo.DailyStairs==1">0分，需极大帮助</span>
                <span v-else-if="assessinfo.DailyStairs==0">0分，完全依赖他人</span>
                <span v-else>10分，可独立上下楼梯（连续上下10-15个台阶）</span>
              </td>
            </tr>
            <tr>
              <td>
                <span class="spanblod">总分</span>
              </td>
              <td class="tableleft">
                {{assessinfo.DailyTotal}}分
              </td>
            </tr>
             <tr>
              <td>
                <span class="spanblod">备注</span>
              </td>
              <td class="tableleft">
                 &nbsp;&nbsp;&nbsp;&nbsp;依据民发〔2016〕178号《特困人员认定办法》，特困人员得分大于60分为良，具备生活自理能力；60—41分为中，有功能障碍，稍依赖，部分丧失生活自理能力；小于40分为差，依赖较明显或完全依赖，完全丧失生活自理能力。
              </td>
            </tr>
          </table>
        </div>
      </Center>
      <br />
    </Card>

    <Modal :mask-closable="false" v-model="modal2" title="查看图片" footer-hide>
      <div>
        <img :src="tmpimg" style="width:100%" />
      </div>
    </Modal>
    <iframe id="iframe-print" frameborder="0" style="display:none" scrolling="auto" :src="printSrc"></iframe>
  </div>
</template>
<script>
import "viewerjs/dist/viewer.css";
import Viewer from "v-viewer/src/component.vue";
import { printUrl } from "@/libs/util";
import { Modal } from "view-design";
import { GetAssessInfoByPersonId } from "@/api/data";
import dayjs from "dayjs";
export default {
  name: "tekun_assess_info",
  data() {
    return {
      printSrc: printUrl + "printlistreport3.html",
      modal2: false,
      tmpimg: "",
      firstlevel: [],
      lelelmemo: [],
      finallevel: [],
      assessperson: {},
      assessinfo: {},
      img1: "",
      img2: ""
    };
  },
  props: {
    id: {
      type: String,
      required: true
    }
  },
   components: {
    Viewer,
  },
  methods: {
    getinfo() {
      GetAssessInfoByPersonId(this.id).then(res => {
        const data = res.data;
        if (data.Type == 1) {
          this.assessperson = data.Data;
          if (this.assessperson.AssessInfo != null) {
            this.firstlevel = [this.assessperson.AssessInfo.FirstLevel + ""];
            this.finallevel = [this.assessperson.AssessInfo.FinalLevel + ""];
            this.lelelmemo = [this.assessperson.AssessInfo.LevelMemo + ""];
            this.assessinfo = this.assessperson.AssessInfo;
            try {
              this.assessinfo.BusinessDate = dayjs(
                this.assessinfo.BusinessDate
              ).format("YYYY年MM月DD日");

              this.assessperson.Birthday = dayjs(
                this.assessperson.Birthday
              ).format("YYYY年MM月DD日");
            } catch (ex) {}
            try {
              this.img1 = this.assessinfo.Imgs[0];
              this.img2 = this.assessinfo.Imgs[1];
            } catch (ex) {}
          }
        } else {
          this.$Modal.error({ title: "提示", content: data.Message });
        }
      });
    },
    bigimg(item) {
      this.tmpimg = item;
      this.modal2 = true;
    },
    PrintReport() {
      document
        .getElementById("iframe-print")
        .contentWindow.LoadData([this.assessperson]);
      document.getElementById("iframe-print").contentWindow.printData();
    }
  },
  created() {},
  mounted() {
    const oIframe = document.getElementById("iframe");
    this.getinfo();
  }
};
</script>
